﻿using 第十次作业学生管理.Data;
using 第十次作业学生管理.Models;
using System.Threading.Tasks;

namespace 第十次作业学生管理.Controllers
{
    public class LogHelper
    {
        private readonly SchoolContext _context;

        public LogHelper(SchoolContext context)
        {
            _context = context;
        }

        public async Task AddLogAsync(string operation)
        {
            var log = new Log
            {
                Operation = operation
            };
            _context.Logs.Add(log);
            await _context.SaveChangesAsync();
        }
    }
}
